name: CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
         fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
        
    - name: Setup .NET 8
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 8.0.100
        
    - name: Install coverlet
      run: dotnet tool install --tool-path . coverlet.console
      
    - name: Build
      run: dotnet build --configuration Release Source/ManagedIrbis5.sln

    - name: Test
      run: dotnet test Source/ManagedIrbis5-windows.sln --no-restore --no-build --configuration Release --settings sequential.runsettings --collect "XPlat Code Coverage" --blame-hang-timeout 5m --blame-hang-dump-type full --blame-crash-dump-type full

    - name: PFT tests
      run: dotnet run --no-build --no-restore --configuration Release --project Source/Tests/PftTests/PftTests.csproj
      
    - name: Barsik tests
      run: dotnet run --no-build --no-restore --configuration Release --project Source/Tests/BarsikTestRunner/BarsikTestRunner.csproj

    - name: Pack
      run: dotnet pack --no-build --no-restore --configuration Release Source/ManagedIrbis5.sln
